<?php /* Smarty version Smarty-3.1.18, created on 2017-09-05 15:58:46
         compiled from "/Applications/MAMP/htdocs/PHP/jifenshop/protected/template/gm/goods.index.html" */ ?>
<?php /*%%SmartyHeaderCode:91380654459ae5936e89568-91028705%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '3816f0d5b4cffbc7de2736b32102c6754c6fcb73' => 
    array (
      0 => '/Applications/MAMP/htdocs/PHP/jifenshop/protected/template/gm/goods.index.html',
      1 => 1504597183,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '91380654459ae5936e89568-91028705',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'id' => 0,
    'keyword' => 0,
    'huohao' => 0,
    'startprice' => 0,
    'endprice' => 0,
    'shops' => 0,
    'shop' => 0,
    'shop_id' => 0,
    'cate_parent' => 0,
    'val' => 0,
    'cate' => 0,
    'row' => 0,
    'cate_id' => 0,
    'boss' => 0,
    'cate_boss' => 0,
    'rs' => 0,
    'page' => 0,
    'oldwhere' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_59ae59370e4fd8_31105878',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_59ae59370e4fd8_31105878')) {function content_59ae59370e4fd8_31105878($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_truncate')) include '/Applications/MAMP/htdocs/PHP/jifenshop/framework/class/smarty-3.1.18/libs/plugins/modifier.truncate.php';
if (!is_callable('smarty_modifier_date_format')) include '/Applications/MAMP/htdocs/PHP/jifenshop/framework/class/smarty-3.1.18/libs/plugins/modifier.date_format.php';
?><?php echo $_smarty_tpl->getSubTemplate ("header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<style type="text/css">
.gm-span{ display: inline-block;width: 50px;text-align: center;text-align: right;padding-right: 3px;}
.gm-span2{ width: 46px;}
.search > input{ width: 160px;}
.red{ color: red;}
#checkboss{ width: 100%;height: 100%;cursor: pointer;text-align: center;}
.fot{ text-align: center;background: none;}
</style>
<div class="page-header">
	<h6>
		商品列表
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			商品列表
		</small>
	</h6>
</div><!-- /.page-header --> 
<div style="margin-top:30px;">
	<form action="?" method="get">
	<div class="search">
	<input type="hidden" name="app" id="app" value="goods" />
	<input type="hidden" name="act" id="act" value="index" />
	<input type="hidden" name="jiage" id="jiage" value="" /> 
	<span class="gm-span"> ID : </span><input type="text" name="id" id="id" value="<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
" /> 
	<span class="gm-span"> 关键词 : </span><input type="text" name="keyword" id="keyword" value="<?php echo $_smarty_tpl->tpl_vars['keyword']->value;?>
" /> 
	<span class="gm-span"> 货号 : </span><input type="text" name="huohao" id="huohao" value="<?php echo $_smarty_tpl->tpl_vars['huohao']->value;?>
" /> <br />
	<span class="gm-span"> 价格 : </span><input type="text" name="startprice" id="startprice" value="<?php echo $_smarty_tpl->tpl_vars['startprice']->value;?>
" />
	<span class="gm-span" style="text-align: center">---</span><input type="text" name="endprice" id="endprice" value="<?php echo $_smarty_tpl->tpl_vars['endprice']->value;?>
"/>
	<span class="gm-span gm-span2"></span>
	<select name="shop_id" id="shop_id" class=" form-control "  data-live-search="true" style="line-heght:30px;display:inline-block;width:160px;">
	<option value=""> 门店 </option>
	<?php  $_smarty_tpl->tpl_vars['shop'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['shop']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['shops']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['shop']->key => $_smarty_tpl->tpl_vars['shop']->value) {
$_smarty_tpl->tpl_vars['shop']->_loop = true;
?>
	<option value="<?php echo $_smarty_tpl->tpl_vars['shop']->value->id;?>
" <?php if ($_smarty_tpl->tpl_vars['shop']->value->id==$_smarty_tpl->tpl_vars['shop_id']->value) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['shop']->value->name;?>
</option>
	<?php } ?>
	</select>
	<select name="cate_id" id="cate" class=" form-control "  data-live-search="true" style="line-heght:30px;display:inline-block;width:160px;">
		<option value=""> 分类: </option>
		<?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['cate_parent']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
?>
			<optgroup label="<?php echo $_smarty_tpl->tpl_vars['val']->value->name;?>
">
				<?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['cate']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value) {
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
					<?php if ($_smarty_tpl->tpl_vars['row']->value->parent_id==$_smarty_tpl->tpl_vars['val']->value->id) {?>
					<option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" <?php if ($_smarty_tpl->tpl_vars['cate_id']->value==$_smarty_tpl->tpl_vars['row']->value->id) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['row']->value->name;?>
</option>
					<?php }?>
				<?php } ?>
			</optgroup>
		<?php } ?>
	</select>
<!-- 	<select name="cate_boss" id="shop_id" class=" form-control "  data-live-search="true" style="line-heght:30px;display:inline-block;width:160px;">
	<option value=""> 一级分类 </option>
	<?php  $_smarty_tpl->tpl_vars['boss'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['boss']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['cate_parent']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['boss']->key => $_smarty_tpl->tpl_vars['boss']->value) {
$_smarty_tpl->tpl_vars['boss']->_loop = true;
?>
	<option value="<?php echo $_smarty_tpl->tpl_vars['boss']->value->id;?>
" <?php if ($_smarty_tpl->tpl_vars['boss']->value->id==$_smarty_tpl->tpl_vars['cate_boss']->value) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['boss']->value->name;?>
</option>
	<?php } ?>
	</select> -->
	<input type="submit" class="btn" value="搜 索" style="width:70px;" /> 
	<div class="clear"></div>
	</div>
	</form>
  </div>
<a href="###" id="change">改变分类</a>
<table id="simple-table" class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th style="padding:0px;"><p id='checkboss'>全选</p></th>
			<th>ID</th>
			<th>图片</th>
			<th>名称</th>
			<th>货号</th>
			<th>简要描述</th>
			<th>积分</th>
			<!-- <th>价格</th> -->
			<!-- <th>促销价、特价</th> -->
			<th>库存</th>
			<th>所属类别</th>
			<!-- <th>所属店铺</th> -->
			<th>所属品牌</th>
			<th>状态</th>
			<th>添加时间</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		<form action="?app=goods&act=check_cate" method="post" id="tochange">
			<!-- 	<input type="hidden" name="app" id="app" value="goods" />
				<input type="hidden" name="act" id="act" value="check_cate" /> -->
		<?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['rs']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value) {
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
		<tr>
			<td><input type="checkbox" name="checkbox[]" id="<?php echo $_smarty_tpl->tpl_vars['row']->value['id'];?>
" value="<?php echo $_smarty_tpl->tpl_vars['row']->value['id'];?>
" /></td>
			<td><?php echo $_smarty_tpl->tpl_vars['row']->value['id'];?>
</td>
			<td style="text-align:left;"><img src="<?php if ($_smarty_tpl->tpl_vars['row']->value['default_pic']!=='') {?><?php echo $_smarty_tpl->tpl_vars['row']->value['default_pic'];?>
<?php } else { ?>/images/nopic.png<?php }?>" width="100" /></td>
			<td style="text-align:left;"><?php echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['row']->value['name'],20);?>
</td>
			<td style="text-align:left;"><?php echo $_smarty_tpl->tpl_vars['row']->value['huohao'];?>
</td>
			<td style="text-align:left;"><?php echo $_smarty_tpl->tpl_vars['row']->value['description'];?>
</td>
			<td style="text-align:left;"><?php echo $_smarty_tpl->tpl_vars['row']->value['integral'];?>
</td>
			<!-- <td style="text-align:left;"><?php echo $_smarty_tpl->tpl_vars['row']->value['price'];?>
</td>
			<td style="text-align:left;"><?php echo $_smarty_tpl->tpl_vars['row']->value['promote_price'];?>
</td> -->
			<td style="text-align:left;"><?php echo $_smarty_tpl->tpl_vars['row']->value['stocks'];?>
</td>
			<td style="text-align:left;"><?php echo $_smarty_tpl->tpl_vars['row']->value['cname'];?>
</td>
			<!-- <td style="text-align:left;"><?php echo $_smarty_tpl->tpl_vars['row']->value['sname'];?>
</td> -->
			<td style="text-align:left;"><?php echo $_smarty_tpl->tpl_vars['row']->value['bname'];?>
</td>
			<td style="text-align:left;"><?php if ($_smarty_tpl->tpl_vars['row']->value['status']==1) {?>正常<?php } else { ?>下架<?php }?></td>
			<td style="text-align:left;"><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['row']->value['add_time'],"%Y-%m-%d");?>
</td>
			<td>
				<a href="index.php?app=goods&act=edit&goods_id=<?php echo $_smarty_tpl->tpl_vars['row']->value['id'];?>
&current_page=<?php echo $_smarty_tpl->tpl_vars['page']->value['current_page'];?>
&oldwhere=<?php echo $_smarty_tpl->tpl_vars['oldwhere']->value;?>
">
					<span class="btn btn-xs btn-info">
					<i class="ace-icon fa fa-pencil bigger-120"></i>
				</span>
				</a>
				<a href="index.php?app=goods&act=delete&goods_id=<?php echo $_smarty_tpl->tpl_vars['row']->value['id'];?>
&current_page=<?php echo $_smarty_tpl->tpl_vars['page']->value['current_page'];?>
&oldwhere=<?php echo $_smarty_tpl->tpl_vars['oldwhere']->value;?>
" class="delete">
					<span class="btn btn-xs btn-danger">
					<i class="ace-icon fa fa-trash-o bigger-120"></i>
				</span>
				</a>
			</td>
		</tr>
		<?php }
if (!$_smarty_tpl->tpl_vars['row']->_loop) {
?>
		<tr bgcolor="white"><td colspan="13" height="50">暂无记录</td></tr>
		<?php } ?>	
		 <!-- 弹出 -->
        <div class="modal fade" id="to-change" role="dialog" aria-labelledby="gridSystemModalLabel">
            <div class="modal-dialog row" role="document" style="margin-top:8%;">
                <div class="modal-content col-lg-8 col-lg-offset-2">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    </div>
                    <form id="receive_form" action="?app=receive&act=add" method="post">
                        <div class="modal-body">
                            <div class="container-fluid">
                            	请选择要改成的分类
                                	<select name="catechange" id="cate" class=" form-control "  data-live-search="true" style="line-heght:30px;display:inline-block;width:160px;">
										<option value=""> 分类: </option>
										<?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['cate_parent']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
?>
											<optgroup label="<?php echo $_smarty_tpl->tpl_vars['val']->value->name;?>
">
												<?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['cate']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value) {
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
													<?php if ($_smarty_tpl->tpl_vars['row']->value->parent_id==$_smarty_tpl->tpl_vars['val']->value->id) {?>
													<option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" <?php if ($_smarty_tpl->tpl_vars['cate_id']->value==$_smarty_tpl->tpl_vars['row']->value->id) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['row']->value->name;?>
</option>
													<?php }?>
												<?php } ?>
											</optgroup>
										<?php } ?>
									</select>
                            </div>
                        </div>
                        <div class="modal-footer fot">
                            <button type="button" class="btn" data-dismiss="modal"> 取消 </button>
                            <button id="get-to" type="button" class="btn"> 提交 </button>
                        </div>
                    </form>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
	</form>
	</tbody>
</table>
	<div class="mypage" style="text-align:right">
			共 <?php echo $_smarty_tpl->tpl_vars['page']->value['num_records'];?>
 个记录  <?php echo $_smarty_tpl->tpl_vars['page']->value['current_page'];?>
 / <?php echo $_smarty_tpl->tpl_vars['page']->value['num_pages'];?>
 页  <?php echo $_smarty_tpl->tpl_vars['page']->value['first_page'];?>
 <?php echo $_smarty_tpl->tpl_vars['page']->value['prev'];?>
 <?php echo $_smarty_tpl->tpl_vars['page']->value['nav'];?>
 <?php echo $_smarty_tpl->tpl_vars['page']->value['next'];?>
 <?php echo $_smarty_tpl->tpl_vars['page']->value['last_page'];?>

	</div>
<?php echo $_smarty_tpl->getSubTemplate ("footer.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<script type="text/javascript">
$(function(){
	$('#endprice').blur(function(){
		var a = $(this).val();
		if( a >= 0 && a !== ''){
			$('#jiage').val(1);
		}else{
			$('#jiage').val('');
		}
	})
	$('#checkboss').click(function(){
		if($(this).hasClass('red')){
			$(this).removeClass('red');
			$(':checkbox').removeProp('checked');
		}else{
			$(this).addClass('red');
			$(':checkbox').prop('checked', true);
		}

	})
	$('#change').click(function(){
        $('#to-change').modal();
    }) 
    $('#get-to').click(function(){
        $('#tochange').submit();
    })
})
</script>
<?php }} ?>
